//
//  ViewController.swift
//  unwindSegue
//
//  Created by 李煜 on 2022/9/22.
//

import UIKit

class RedVC: UIViewController {

  override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.
  }
  @IBAction func unwindToRedVCWithCode(_ unwindSegue: UIStoryboardSegue) {
    let sourceViewController = unwindSegue.source
    // Use data from the view controller which initiated the unwind segue
  }
  @IBAction func unwindToRedVCWithButton(_ unwindSegue: UIStoryboardSegue) {
    let sourceViewController = unwindSegue.source
    // Use data from the view controller which initiated the unwind segue
    //    clickButtonToRedVC
    //    codeToRedVC
    if sourceViewController is BlueVC {
      print("从blue过来")
    }else if sourceViewController is GreenVC {
      print("从green过来")
    }
  }
}

